package ifSwitchPlugins;

public class BasicIfValid {

	private static final int TWO = 2;
	private static final int ONE = 1;

	private int x;
	
	public int getX() {
		return x;
	}

	public void chainedIf(int y){
		if ( x == ONE )
			System.out.println("one");
		else if ( x == TWO ) {
			y = x*2;
			System.out.println("many");
		} else {
			y = -x;
			System.out.println("negative");
		}
	}
	
	public void chainedIfMethod(int y){
		if ( getX() == ONE )
			System.out.println("one");
		else if ( getX() == TWO ) {
			y = x*2;
			System.out.println("many");
		} else {
			y = -x;
			System.out.println("negative");
		}
	}
	
	public void chainedIfParam(int x, int y){
		if ( x == ONE )
			System.out.println("one");
		else if ( x == TWO ) {
			y = x*2;
			System.out.println("many");
		} else {
			y = -x;
			System.out.println("negative");
		}
	}
}